/**
 * 
 */
package com.kavitha.learn.spring1;

import java.util.List;

import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

/**
 * @author Vijayan Srinivasan
 * @since Apr 25, 2013 10:42:15 PM
 * 
 */
public class EmployeeDAO {

	private JdbcTemplate jdbcTemplate;

	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}
	
	public List<Employee> getAllEmployees(){
		String sql = "select * from employee";
		return jdbcTemplate.query(sql , new BeanPropertyRowMapper<Employee>(Employee.class));
	}
	
	
}
